package com.java.service.Impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.java.mapper.AdminMapper;
import com.java.po.Admin;
import com.java.service.AdminService;

@Service
public class AdminServiceImpl implements AdminService {

	@Autowired
	private AdminMapper adminMapper;

	@Override
	public int insertAdminOne(Admin admin) throws Exception {
		// TODO Auto-generated method stub
		return adminMapper.insertAdmin(admin);
	}

	@Override
	public int deleteAdminById(Integer id) throws Exception {
		// TODO Auto-generated method stub
		return adminMapper.deleteAdmin(id);
	}

	@Override
	public int updateAdminById(Admin admin) throws Exception {
		// TODO Auto-generated method stub
		return adminMapper.updateAdmin(admin);
	}

	@Override
	public Admin findByNameAndStuId(Integer id, String username, String password) {
		// TODO Auto-generated method stub
		return adminMapper.findByuserNameAndAdminId(id, username, password);
	}

	@Override
	public List<Admin> ListAdmin(Map<String, Object> queryMap) throws Exception {
		// TODO Auto-generated method stub
		return adminMapper.findListAdmin(queryMap);
	}

}
